from django.contrib import admin
from .models import LinuxAccess, QadAccess, UriProgramMapping, ApiData, ApiLogs


@admin.register(LinuxAccess)
class LinuxAccessAdmin(admin.ModelAdmin):
    list_display = ('company_code',
                    'company_name',
                    'server_code',
                    'ip_address',
                    'port',
                    'userid',
                    'password',
                    'uri',
                    'work_path',
                    'in_path',
                    'out_path',
                    'success_path',
                    'error_path',
                    'archive_path')

    search_fields = list_display
    list_filter = list_display


@admin.register(QadAccess)
class QadAccessAdmin(admin.ModelAdmin):
    list_display = ('company_code',
                    'company_name',
                    'userid',
                    'password',
                    'domain',
                    'user'
                    )
    search_fields = list_display
    list_filter = list_display


@admin.register(UriProgramMapping)
class UriProgramMappingAdmin(admin.ModelAdmin):
    list_display = ('company_code',
                    'company_name',
                    'uri',
                    'qad_program_code',
                    'script_path',
                    'script_name',
                    'script_program',
                    'user')
    search_fields = list_display
    list_filter = list_display


@admin.register(ApiData)
class ApiDataAdmin(admin.ModelAdmin):
    list_display = ('user',
                    'company_code',
                    'company_name',
                    'uri',
                    'json_data',
                    'data_id',
                    'status')
    search_fields = list_display
    list_filter = list_display


@admin.register(ApiLogs)
class ApiLogAdmin(admin.ModelAdmin):
    list_display = ('user',
                    'company_code',
                    'company_name',
                    'request_id',
                    'request_ip',
                    'response_code',
                    'trace_id',
                    'data_id',
                    'status')

    search_fields = list_display
    list_filter = list_display


